#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@author:shengwei
@file:chardet_py.py
@time:2018/2/26 002616:06
"""
import chardet

print(chardet.detect(b'Hello, world!'))

data = '离离原上草，一岁一枯荣'.encode('gbk')
print(chardet.detect(data))
